<?php

class HomeController extends BaseController {

	/*
	|--------------------------------------------------------------------------
	| Default Home Controller
	|--------------------------------------------------------------------------
	|
	| You may wish to use controllers instead of, or in addition to, Closure
	| based routes. That's great! Here is an example controller method to
	| get you started. To route to this controller, just add the route:
	|
	|	Route::get('/', 'HomeController@showWelcome');
	|
	*/

	public function showWelcome()
	{
		return View::make('hello');
	}
	public function login()
	{
		return View::make('public.login')
				->with('title', 'Login Panel :: Task Management Apps');
	}
	public function register()
	{
		return View::make('public.register')
				->with('title', 'Registration Panel :: Task Management Apps');
	}
	public function authentication()
	{
		$user = array(
				'email' => Input::get('email'),
				'password' => Input::get('password')
			);
		if(Auth::attempt($user))
		{
			return Redirect::route('dashboard')->with('message', 'You are logged in successfully !');
		}
		else
		{
			return Redirect::route('login')->with('message', 'Your Email/Password combination is not right. Try Again.');
		}
	}
	public function registration()
	{
		
	}

}
